package GUI;

import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JFrame;

import conference.Conference;

import papers.Manuscript;

/**
 * A frame class that call some panels to allow 
 * to add reviewer to a manuscript.
 * @author Dickson Kwong
 * @version v1.0 Nov. 27, 2011
 */
@SuppressWarnings("serial")
public class PCAddReviewerFrame extends JFrame{
	/**
	 * The manuscript object.
	 */
	private Manuscript my_manu;
	
	/**
	 * The conference object.
	 */
	private Conference my_conference;
	
	/**
	 * The PCAddReviewerFrame Constructor. It creates a 
	 * frame for adding reviewer.
	 * @param the_manuscript The manuscript
	 * @param the_conference The conference
	 */
	public PCAddReviewerFrame(Manuscript the_manuscript
			, Conference the_conference){
		this.setPreferredSize(new Dimension(808	,630));
		this.setDefaultCloseOperation(DISPOSE_ON_CLOSE);
		this.setVisible(true);
		this.setLayout(new BorderLayout());
		this.setTitle("Add reviewer for " + the_manuscript.getPaperName());
		my_manu = the_manuscript;
		my_conference = the_conference;
		start();
	}
	
	/**
	 * It add all the necessary panels to the frame.
	 */
	private void start(){
		PCViewReviewerPanel view_panel = 
			new PCViewReviewerPanel(my_manu, my_conference.getUsers());
		PCViewAllUserPanel user_panel = 
			new PCViewAllUserPanel(my_manu,view_panel , my_conference);
		PCInfoPanel info_panel = new PCInfoPanel(my_manu, this);
		
		add(info_panel, BorderLayout.NORTH);
		add(user_panel, BorderLayout.WEST);
		add(view_panel, BorderLayout.EAST);
		pack();
		setResizable(false);
		setLocationRelativeTo(null);
	}

}
